<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>资料下载</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <script type="text/javascript" src="__JS__/menu.js"></script>
    <script type="text/javascript" src="__JS__/leftmenubar.js"></script>
    <script type="text/javascript" src="__JS__/jshelper.js"></script> 
    <script type="text/JavaScript">
                    function fileedit(id){
                        window.location.href="__URL__/fileedit/id/"+id;
                    }
                    function filesearch(id){
                        window.location.href="__URL__/filedetail/id/"+id;
                    }
                    function filedelete(id,courseid){
                        if (confirm("你确定要删除吗")==true)
                            postwith('__URL__/filedelete',{id:id,courseid:courseid});
                    }
                        window.onload=show;
        </script>
</head>
<body>
	 <!-- layout::Auth:header::0 -->
     <div class="container-fluid">
      	<div class="row-fluid">
            <!-- layout::Auth:Courseleftmenu::0 -->
                <div class="span8">
                  <div class="hero-unit">
                    <h1>资料下载</h1>
                     <p style="font-size:12px">
                         当前位置：
                            <a href='__APP__/index/index' class="nowpositionhref">主页</a>>
                            <a href='__URL__/index' class="nowpositionhref">课程展示</a>>
                            <a href='__URL__/course/id/<?php echo ($id); ?>' class="nowpositionhref"><?php echo ($coursename); ?></a>>
                            <a href="" class="nowpositionhref" >资料下载</a>
                      </p>
                  </div>
                   <load href"__PUBLIC__/js/list_show.js">
                   <!--测试代码-->
                         <table class="table table-bordered table-striped">
                            <thead>
                              <tr>
                                <th style="display:none">ID</th> 
                                <th width="9%">下载量</th>
                                <th class="span5">标题</th>
                                <th class="span1">作者</th>
                                <th class="span2">发表时间</th>
                                <?php if($a == 0): ?><?php else: ?>
                                <th class="span3">操作</th><?php endif; ?>
                              </tr>
                            </thead>
                            <tbody>
                                <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><tr>
                                    <td style="display:none">
                                        <?php echo ($vo["id"]); ?>
                                    </td>
                                    <td>
                                        <?php echo ($vo["downloadno"]); ?><!--下载量-->
                                    </td>
                                    <td>
                                     	<a href="__ROOT__<?php echo ($vo["path"]); ?><?php echo ($vo["savename"]); ?>" target="_blank"><?php echo ($vo["name"]); ?></a><!--标题-->
                                    </td>
                                    <td>
                                       <?php echo ($vo["nname"]); ?><!--作者-->
                                    </td>
                                    <td>
                                        <?php echo ($vo["time"]); ?><!--发表时间-->
                                    </td>
                                   <?php if($a == 0): ?><?php else: ?>	<!--操作-->
                                    <td>
                                        <a href="#" name='edit_file'  onClick='fileedit(<?php echo ($vo["id"]); ?>)' class="btn btn-primary">编辑</a>
										<a href="#"  name='delete_file' onClick='filedelete(<?php echo ($vo["id"]); ?>,<?php echo ($vo["courseid"]); ?>)' class="btn btn-danger">删除</a>
                                    </td><?php endif; ?>
                                  </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                            </tbody>
                        </table>
                  <!--/测试代码-->
                  <p class="navbar-text pull-right"><?php echo ($page); ?></p>
                </div>
         </div>
      </div>
</body>
</html>